<template>
  <div class="home-container">
    <div class="welcome-section">
      <h1>欢迎使用 Vue 3 + Vite 自动路由系统</h1>
      <p class="description">这是一个基于 Vue 3 和 Vite 构建的自动路由系统示例。系统会自动识别 <code>views</code> 目录下的所有 <code>*/index.vue</code> 文件并生成对应的路由。</p>
    </div>
    
    <div class="features-section">
      <h2>主要特点</h2>
      <ul>
        <li>
          <span class="feature-icon">🚀</span>
          <div class="feature-content">
            <h3>自动路由生成</h3>
            <p>无需手动配置路由，系统会自动扫描 views 目录并生成路由</p>
          </div>
        </li>
        <li>
          <span class="feature-icon">🔄</span>
          <div class="feature-content">
            <h3>动态导航菜单</h3>
            <p>导航菜单会根据路由自动更新</p>
          </div>
        </li>
        <li>
          <span class="feature-icon">✨</span>
          <div class="feature-content">
            <h3>页面过渡动画</h3>
            <p>内置平滑的页面切换动画</p>
          </div>
        </li>
      </ul>
    </div>
    
    <div class="usage-section">
      <h2>如何使用</h2>
      <div class="code-block">
        <pre><code>// 在 views 目录下创建新页面
└── views/
    ├── a/
    │   └── index.vue  // 路由: /a
    └── b/
        └── index.vue  // 路由: /b</code></pre>
      </div>
    </div>
  </div>
</template>

<script setup>
// 首页组件逻辑
</script>

<style scoped>
.home-container {
  max-width: 800px;
  margin: 0 auto;
}

.welcome-section {
  margin-bottom: 40px;
  text-align: center;
}

h1 {
  color: #42b883;
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.description {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
}

code {
  background-color: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #e96900;
}

.features-section {
  margin-bottom: 40px;
}

h2 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 20px;
  border-bottom: 2px solid #eaeaea;
  padding-bottom: 10px;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 25px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

li:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-right: 20px;
  color: #42b883;
}

.feature-content {
  flex: 1;
}

h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2c3e50;
}

.usage-section {
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.code-block {
  background-color: #2d2d2d;
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
}

pre {
  margin: 0;
}

.code-block code {
  color: #e6e6e6;
  background: none;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}
</style>